package com.it.shiro.sys.controller;


import com.it.base.resposne.JsonData;
import com.it.shiro.sys.entity.User;
import com.it.shiro.sys.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: learning
 * @description: 用户模块控制层
 * @author: Lefnmg
 * @create: 2018-11-02 23:30
 **/
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private IUserService userService;

    /**
     * 获取用户详情
     * @param id
     * @return
     */
//    @RequiresPermissions("sys:user:findIds")
    @RequestMapping("/findById/{id}")
    public JsonData findById(@PathVariable("id") Long id){
        User user = userService.findById(id);
        return JsonData.ok().put("body",user);
    }
}
